package com.baturu.vin.byd.dto;

import com.baturu.vin.dto.EPCImagePointDTO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 比亚迪图片DTO
 * @author jiangxinlei
 * @Time 2018/1/9.
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class BydImageDTO {

    private Long dataLegendId;

    private String imageName;

    private Double x;

    private Double y;

    private String callout;

    private Integer carSystemId;

    private Integer dataGroupId;

    public EPCImagePointDTO getTopLeft() {
        EPCImagePointDTO epcImagePointDTO = new EPCImagePointDTO();
        epcImagePointDTO.setX((int) (Math.floor(x)-7));
        epcImagePointDTO.setY((int) (Math.floor(y)-7));
        return epcImagePointDTO;
    }

    public EPCImagePointDTO getBottomRight() {
        EPCImagePointDTO epcImagePointDTO = new EPCImagePointDTO();
        epcImagePointDTO.setX((int) (Math.floor(x)+7));
        epcImagePointDTO.setY((int) (Math.floor(y)+7));
        return epcImagePointDTO;
    }

}
